import { createApi } from '@ajax'
import { baseURL, path } from '@config'

const prefix = 'blog'
const option = { baseURL: baseURL }

// 菜单管理
export const fetchModuleList = createApi(`${path}/${prefix}/menu/listMenu`, option) // 获取模块列表
export const fetchMenuDel = createApi(`${path}/${prefix}/menu/delMenu`, option) // 删除模块
export const fetchModuleDetail = createApi(`${path}/${prefix}/menu/getMenu`, option) // 获取模块详情
export const fetchChangeModuleStatus = createApi(`${path}/${prefix}/resource/updateStatus`, option) // 修改模块显隐状态
export const fetchUpsertMenu = createApi(`${path}/${prefix}/menu/upsertMenu`, option) // 新增、修改模块详情
export const fetchButtonList = createApi(`${path}/${prefix}/resource/button/list`, option) // 按钮权限列表

// 文章管理
export const fetchArticleList = createApi(`${path}/${prefix}/article/listArticle`, option) // 获取文章列表
export const fetchArticleDel = createApi(`${path}/${prefix}/article/delArticle`, option) // 删除文章
export const fetchArticleDetail = createApi(`${path}/${prefix}/article/getArticle`, option) // 获取文章详情
export const fetchChangeArticleStatus = createApi(`${path}/${prefix}/resource/updateStatus`, option) // 修改文章显隐状态
export const fetchArticleUpsert = createApi(`${path}/${prefix}/article/upsertArticle`, option) // 新增、修改文章详情
